#ifndef __VCMD_H__
#define __VCMD_H__

#include "config.h"

#define VGDB_VCA_LEN        64
#define VGDB_BID_SOURCE     1 
#define VGDB_BID_GOUTP       2
#define VGDB_VCF_TBL_LEN    256

typedef struct {
    int     vcid;
    int     bid;
    int     seqno;
    char    args[VGDB_VCA_LEN];
}vcmd_t;

typedef void (*vcfunc)(vcmd_t*);

typedef struct {
    vcfunc      func;
    char       *name;
}vcf_t;

extern  vcf_t   g_vcf_tbl[VGDB_VCF_TBL_LEN];


extern void vcmd_init     ();
extern  int vcmd_hash     (const char *, int, int);

extern void vcmd_quit     (vcmd_t *);
extern void vcmd_print    (vcmd_t *);
extern void vcmd_step     (vcmd_t *);
extern void vcmd_run      (vcmd_t *);
extern void vcmd_break    (vcmd_t *);
extern void vcmd_continue (vcmd_t *);
extern void vcmd_clear    (vcmd_t *);
extern void vcmd_initopwin(vcmd_t *);

#define vcmd_func(vcid) (g_vcf_tbl[vcid].func)
#define vcmd_name(vcid) (g_vcf_tbl[vcid].name)
#define vcmd_exec(vcmd) (vcmd_func((vcmd)->vcid)(vcmd))
#define vcmd_vcid(vstr) (vcmd_hash((vstr), 0, (VGDB_VCF_TBL_LEN-1)))

#endif
